<style type="text/css">
.normal_form[form-role="dialog"] {padding-top:30px;}
.normal_form[form-role="dialog"] .input-text{width:250px;}
</style>
<form name="dialogform" class="normal_form" form-role="dialog" onsubmit="return Core.Sys.Dialogform(this);" autocomplete="off">
    <div class="row">
        <div class="field_text">姓名：</div>
        <input type="text" class="input-text" name="realname" value="{$res['realname']}" disabled />
    </div>
    <div style="padding-left:100px;color:gray;line-height:30px;">密码长度不能少于8个字符、必须包含字母、数字及特殊字符</div>
    <div class="row">
        <div class="field_text">新密码：</div>
        <input type="text" class="input-text" name="password" value="" maxlength="50" placeholder="请输入新密码" />
    </div>
    
    <div class="row form-footer-bar">
        <p class="colortip"></p>
        <button class="btn" role="btn-cancel">取消</button>
        <button class="btn btn-primary" type="submit" role="btn-submit">保存</button>
    </div>
</form>
<script type="text/javascript">
Core.Sys.Dialogform = function(form){
    var form = $(form);
    var p    = {
		'password' : form.find(":text[name='password']").val(),
	}

    if (!Core.rule('password',p['password'])){
		form.find("p.colortip").html('请设置规范的新密码!');return false;
	}

	form.find(":button").attr('disabled','disabled');
	$.ajax({type : "POST",dataType: "json",cache : false, url : "{$_G['_mca_']}/mid/{$res['mid'] ?? ''}?r="+Math.random(),data : p,success: function(data){
	   try{
		   if (data['state'] == 'y'){
                $('#datalist').datagrid('reload');$(form).dialogClose();
		   } else {
                form.find(":button").removeAttr('disabled');form.find("p.colortip").html(data['msg']);return false;
		   }
	   }catch(e){form.find(":button").removeAttr('disabled');form.find("p.colortip").html('数据提交失败!');return false;}
	}});
	return false;
}
$(function(){
    $('.oselectregion').oselect([{
        type: 'easyui',
        url: "/index.ajax/district/level/1",
        fieldv: 'id',
        fieldt: 'name',
        filter: function(result) {
            return result['rows'];
        }
    },{
        type: 'easyui',
         url: "/index.ajax/district/level/2/pid/@parentValue",
        fieldv: 'id',
        fieldt: 'name',
        filter: function(result) {
            return result['rows'];
        }
    },{
        type: 'easyui',
         url: "/index.ajax/district/level/3/pid/@parentValue",
        fieldv: 'id',
        fieldt: 'name',
        filter: function(result) {
            return result['rows'];
        }
    }], function (event, elem, id, txt) {
        // console.log('oselectseries:', id, '|', txt);
    });
});
</script>